/*
 * 2014-10-21 <br/>
 *
 * Copyright (c) 1994-1999 AnHui LonSun, Inc. <br/>
 * All rights reserved.	<br/>
 *
 * This software is the confidential and proprietary information of AnHui	<br/>
 * LonSun, Inc. ("Confidential Information").  You shall not	<br/>
 * disclose such Confidential Information and shall use it only in	<br/>
 * accordance with the terms of the license agreement you entered into	<br/>
 * with Sun. <br/>
 */
package cn.bs.socket.client;

import java.io.*;
import java.net.InetAddress;
import java.net.Socket;

public class MyClientA {
    private int port= 7011;
    public void run() throws IOException {
        InetAddress addr = InetAddress.getByName(null);
        Socket socket = new Socket(addr,port);
        BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
        PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())),true);
       for(int k=0;k<10;k++){
           out.println("hello-" + k);
           String str = in.readLine();
           System.out.println(str);
       }
       out.println("end");
       socket.close();
    }
}
